package com.example.JavaConcurrent.Project2_CountDownLatchAndCyclicBarrier.CyclicBarrierBegin_5;

import java.util.concurrent.CyclicBarrier;

public class Run {
    public static void main(String[] args) throws InterruptedException {



        CyclicBarrier cbRef = new CyclicBarrier(4, new Runnable() {
            @Override
            public void run() {
                System.out.println("都到了");

            }
        });

        MyThread t1  = new MyThread(cbRef);
        t1.setName("t1");
        t1.start();

        MyThread t2  = new MyThread(cbRef);
        t2.setName("t2");
        t2.start();

        MyThread t3  = new MyThread(cbRef);
        t3.setName("t3");
        t3.start();


        MyThread t4  = new MyThread(cbRef);
        t4.setName("t4");
        t4.start();

    }
}
